import request from '@/utils/request'



//上传咨询附件到阿里云OSS存储中
export function uploadAttachmentFile(data) {
  return request({
    url:'/aliyun/oss/attachment',
    method:'post',
    data: data,
    headers:{'Content-Type': 'multipart/form-data'}

  })
}
//上传咨询图片到阿里云OSS存储中
export function  uploadArticleImagesByOss(data) {
  return request({
    url: '/aliyun/oss/article',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'multipart/form-data'}

  })
}

//增加咨询
export function createArticle(data) {
  return request({
    url: '/nms/nmsArticle/save',
    method: 'post',
    data: data
  })
}

//根据ID删除咨询
export function deleteArticle(id) {
  return request({
    url:'/nms/nmsArticle/delete/'+ id,
    method:'get',
  })
}

//修改咨询
export function updateArticle(data) {
  return request({
    url: '/nms/nmsArticle/update' ,
    method: 'post',
    data: data
  })
}

//根据ID获取咨询信息
export function selectArticle(id) {
  return request({
    url: '/nms/nmsArticle/findById/' + id,
    method: 'get',
  })

}

//分页查询
export function findByPage(data) {
  return request({
    url: '/nms/nmsArticle/findByPage',
    method: 'post',
    data: data
  })

}
//(网站前台)根据咨询栏目ID获取对应咨询列表
export function findListByChannelId(id) {
  return request({
    url: '/nms/nmsArticle/findListByChannelId/'+id,
    method: 'get',
  })

}
//(网站前台)根据咨询ID获取咨询详情
export function getArticleDetail(id) {
  return request({
    url: '/nms/nmsArticle/getArticleDetail/' + id,
    method: 'get',
  })
}

//(网站前台)获取当前热度文章
export function findHostArticleList() {
    return request({
      url: '/nms/nmsArticle/findHostArticleList',
      method: 'get',
    })
}














